

#UPLOAD MOMENTS - CONDITIONING ON GOVERNMENT IS OF THE C-TYPE
## ------------------------------------------------------------------- ##
#Elements of each vector: [ E(b/y | C-type); E(SP ∣ C-tpe);  std(SP ∣ C-tpe);  E(RP ∣ C-tpe);  std(RP ∣ C-tpe) ]

# Upload simulated moments for the baseline model
mmsC_base   = readdlm("../01_Baseline_Model/simulated_moments/spread_decomposition.txt", ',', Float64)
#Upload simulated moments for the perfect information counterfactual
mmsC_Pinf   = readdlm("../02_Perfect_Information/simulated_moments/target_moments_PerfectInfo.txt", ',', Float64)  #Perfect Information
mmsC_FixT   = readdlm("../02_Perfect_Information/simulated_moments/target_moments_Ctype.txt", ',', Float64)  #Constant Types


################# ------------------------------------------------------------------------------------- #################
################# -------------------------------- *** MAIN TABLES *** -------------------------------- #################
################# ------------------------------------------------------------------------------------- #################

### COMPARISON OF BASELINE MODEL WITH PERFECT INFORMATION CASE
open("tables/Ctype_mms.txt", "w") do io
write(io, "\\begin{table}[H] \n")
write(io, "\\centering \n")
write(io, "\\begin{tabular}{lcccccc} \n")
write(io, "\\hline \\hline \n")
write(io, " & \\multicolumn{3}{c}{Debt and Spreads} & & \\multicolumn{2}{c}{Reputation Premium} \\\\ \n")
write(io, " & \$\\mathbb{E}[D/Y]\$ & \$\\mathbb{E}[SP]\$ & \$\\sigma(SP)\$ & & \$\\mathbb{E}[\\Upsilon]\$ & \$\\sigma[\\Upsilon]\$ \\\\ \n")
write(io, "\\hline \n")
write(io, "Baseline Model 		    & \$$(round(Int, mmsC_base[1]))\\%\$ & \$$(round(Int, mmsC_base[2]))\$bp & \$$(round(Int, mmsC_base[3]))\$bp & & \$$(round(Int, mmsC_base[4]))\$bp & \$$(round(Int, mmsC_base[5]))\$bp\\\\ \n")
write(io, "Fixed \$C\$-type         & \$$(round(Int, mmsC_FixT[1]))\\%\$ & \$$(round(Int, mmsC_FixT[2]))\$bp & \$$(round(Int, mmsC_FixT[3]))\$bp & & - & - \\\\ \n")
write(io, "Perfect Information   	& \$$(round(Int, mmsC_Pinf[1]))\\%\$ & \$$(round(Int, mmsC_Pinf[2]))\$bp & \$$(round(Int, mmsC_Pinf[3]))\$bp & & - & - \\\\ \n")
write(io, "\\hline \\hline \n")
write(io, "\\end{tabular} \n")
write(io, "\\end{table} \n")
end
